package com.omt.tarjimdinek.domain.member.dao;

import java.util.List;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.persistence.Query;

import com.omt.tarjimdinek.domain.member.entity.Pays;
import com.omt.tarjimdinek.support.GenericDao;

/**
 * Country DAO implements
 * @author chabane
 *
 */
@Named("paysDao")
@Singleton
public class PaysDao extends GenericDao<Pays, Integer> implements IPaysDao {

    public PaysDao() {
        super(Pays.class);
    }
    /**
     * {@inheritDoc}
     */
	public List<Pays> findAll() {
		StringBuffer lQuerySelect = new StringBuffer("SELECT DISTINCT p FROM Pays p ");
    
    	StringBuffer lQueryString = new StringBuffer();
    	lQueryString.append(lQuerySelect);
    	
    	Query lQuery = getEntityManager().createQuery(lQueryString.toString());

    	return  (List<Pays>) lQuery.getResultList();
	}

}
